<template>
	<!-- 我的关注专业-组件 -->
	<scroll-view scroll-y="true" class="my-major">
		<!-- 我的关注列表模块 -->
		<major-job-cell
			v-if="list.length"
			v-for="(item, index) in list"
			:item="item"
			:type="type"
			:key="index"
		></major-job-cell>
		<!-- 缺省图模块 -->
		<view class="no-data" v-else>
			<image
				src="https://mcdn.chatgk.com/xcx/static/images/seejob/paynoattention.png"
				mode=""
				class="picture"
			></image>
			<view class="title-first">还没有关注的{{ type ? '职业' : '专业' }}</view>
			<view class="title-two">先去关注喜欢的{{ type ? '职业' : '专业' }}吧</view>
			<view class="button" @click="onGoAllOccupation">关注{{ type ? '职业' : '专业' }}</view>
		</view>
	</scroll-view>
</template>

<script>
import MajorJobCell from '@/components/major-job-cell/major-job-cell.vue';
export default {
	props: {
		// 我的关注列表
		list: {
			type: Array,
			default: () => []
		},
		// 类型 0：专业， 1： 职业
		type: {
			type: Number,
			default: 0
		}
	},
	components: {
		MajorJobCell
	},
	methods: {
		onGoAllOccupation() {
			this.$parent.changeTab(2);
		}
	}
};
</script>

<style lang="scss" scoped>
.my-major {
	// padding: 30rpx;
	height: calc(100vh - 90rpx);

	.major-box {
		width: 100vw;
		padding: 30rpx;
		display: flex;
		justify-content: space-between;
		align-items: center;
		border-bottom: 1rpx solid #999;
		box-sizing: border-box;

		image {
			width: 20rpx;
			height: 30rpx;
		}
	}

	.major-item {
		width: 70%;
		height: 100rpx;
		display: flex;
		justify-content: center;
		flex-direction: column;

		& > view {
			font-size: 30rpx;
		}

		.minor-text {
			margin-top: 10rpx;
			font-size: 24rpx;
			color: #aaa;
		}
	}
}

.no-data {
	position: absolute;
	top: 50%;
	left: 50%;
	transform: translate(-50%, -50%);
	color: #ccc;
	text-align: center;

	.title-first {
		color: #6c6c6c;
		font-size: 28rpx;
		font-weight: bold;
	}

	.title-two {
		font-size: 24rpx;
		margin: 10rpx 0;
		color: #a6a7ac;
	}

	.picture {
		width: 280rpx;
		height: 200rpx;
	}

	.button {
		height: 76rpx;
		line-height: 76rpx;
		width: 303rpx;
		color: #fff;
		font-size: 32rpx;
		font-weight: bold;
		text-align: center;
		background-color: #ff4548;
		border-radius: 38rpx;
		font-size: 24rpx;
	}
}
</style>
